package com.bstek.demo.test;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @Title: RegexExample
 * @Package: com.bstek.demo.test
 * @Description:
 * @Author: zxq
 * @Date: 2023/9/25 - 16:54
 */
public class RegexExample {
    public static void main(String[] args) {
        String phoneNumber = "13812345678";
        String emailNumber = "118@163.com";
        String email="[a-zA-Z0-9]{3,20}@[a-zA-Z0-9]{2,10}[.](com|cn|net)";

        String regex = "^1[3-9]\\d{9}$";
        Pattern pattern = Pattern.compile(email);
        Matcher matcher = pattern.matcher(emailNumber);
        System.out.println(matcher.matches());

    }

}
